<template>
	<view>
		<uni-card 
			v-for="(item, index) in cards" 
			:key="index" :title="item.TranName" 
			:extra="item.ToAccount"
		>
			<view class="textAll">
				<text class="textA">交易金额:{{item.SubAmt}}</text>
				<text class="textB">{{item.JndateTime}}</text>
			</view>
		</uni-card>
	</view>
</template>

<script>
	import {mixin} from '../../../mixin.js'
	export default {
		data() {
			return {
				pageNow:1,
				cards:[]
			};
		},
		mixins:[mixin],
		onLoad() {
			console.log("666")
			this.getList()
		},
		methods:{
			getList(){
				const params = {
					clienttype:'Android',
					iplanetdirectorypro:uni.getStorageSync('msg'),
					pageindex:this.pageNow,
					pagesize:10,
					schoolcode:'ccufe'
				}
				console.log('666')
				
				uni.request({
					url:"http://ykt.ccufe.com:8070/Api/Card/GetAllSubsidyTrjn",
					method:'POST',
					header:{
						'Cache-Control':'no-cache',
						'Accept':'*/*',
						'Accept-Encoding':'gzip',
						'Connection':'keep-alive',
						'Content-Type':'application/x-www-form-urlencoded',
						'Content-Length':'154'
					},
					data:{
						clienttype:'Android',
						iplanetdirectorypro:uni.getStorageSync('msg'),
						pageindex:this.pageNow,
						pagesize:10,
						schoolcode:'ccufe',
						sign:this.getMd5(this.getObjToStr(params))
					},
					success:res=>{
						if(res.data.success==false || res.data.success=='false'){
							uni.showModal({
								content:'未登录或登录已失效',
								showCancel:false,
							})
							return 0
						}
						if(res.data.success==true || res.data.success=='true'){
							this.cards = [...this.cards, ...res.data.obj]
						}
					},
					complete:e=> {
						console.log(e)
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.textAll{
		display: flex;
		justify-content: space-between;
	}
	.textA{
		font-size: 30rpx;
		color: rgba(0, 0, 0, 0.5);
	}
	.textB{
		font-size: 30rpx;
		color: rgba(0, 0, 0, 0.5);
	}
</style>
